package com.shallowUniverse.dmp.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Service;

/**
 * @author Shuai Guo
 * @version 1.0
 * @description
 * @date 2021/8/5
 */
@Service
public class SidGenerator {

    private final Snowflake snowflake;

    public SidGenerator() {
        snowflake = IdUtil.getSnowflake(4L, 1L);
    }

    public Long generate() {
        return snowflake.nextId();
    }
}
